package design.mode.effective_java.chapter7.item45;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;

/**
 * @author ZhongMingde on 2021/8/31
 */

public class Test {
    public static void main(String[] args) {
        String word = "zzzz";
        Map<String, Set<String>> map  = new HashMap<>();
        map.computeIfAbsent(word, (unsed) -> new TreeSet<>()).add(word);
        map.computeIfAbsent(word, (unsed) -> new TreeSet<>()).add("111");
        map.forEach((k,v)->{
            System.out.println(k +  "  "+  v);
        });
    }
}
